#!/bin/bash
# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: jaewon

set -e

WORKING_DIR="/remote/iosg/home/jaewon/ops/bitmex/"

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd "${SCRIPT_DIR}"
REPO_ROOT_REL="$(git rev-parse --show-toplevel)"
REPO_ROOT="$(realpath "${REPO_ROOT_REL}")"
BITMEX_UNAVAIL_FILE="${REPO_ROOT}/python/coin/strategy/data/bitmex_unavailability.txt"

git checkout -q "${BITMEX_UNAVAIL_FILE}"

cd "${WORKING_DIR}"
scp -q -F ssh_config/ssh_config \
  jaewon-work-2.ap-southeast-1:/home/ec2-user/ops/bitmex_unavailability.txt \
  "${REPO_ROOT}/python/coin/strategy/data/bitmex_unavailability.txt"
